#include <iostream>
#include <vector>

using namespace std;

int main() {
    string seat;
    cin >> seat;

    int result = 0, n = seat.length();

    // pre 用于表示前一个座位的状态， 0表示该座位没有坐人，1表示该座位已经坐人
    char pre = '0';
    for(int i = 0; i < n; i++) {
        // seat[i] 没有人座 且两边都没有人座
        if(pre == '0' && seat[i] == '0' && (i + 1 == n || seat[i+1] == '0')) {
            result++;
            pre = '1';
            continue;
        }
        pre = seat[i];
    }

    cout << result << endl;

    return 0;
}

/*
#include <iostream>
 
using namespace std;
 
int main() {
    string desk;
    cin >> desk;
 
    int ans = 0;
    for (int i = 0; i < desk.size(); i++) {
        if (desk[i] == '0') {
            bool isLeftEmpty = i == 0 || desk[i - 1] == '0';
            bool isRightEmpty = i == desk.size() - 1 || desk[i + 1] == '0';
 
            if (isLeftEmpty && isRightEmpty) {
                ans++;
                desk[i] = '1';
                i++;
            }
        }
    }
 
    cout << ans << endl;
 
    return 0;
}
*/
